<template>
    <div>
        <Form :label-width="130" inline>
            <!--<Row>-->
                <!--<i-col span="12">-->
                    <!--<Button type="primary" style="" @click="handleAddNew">新增</Button>-->
                <!--</i-col>-->
            <!--</Row>-->
        </Form>
        <div style="margin-top: 20px">
            <vxe-table border
                       resizable
                       row-id="id"
                       :row-key="true"
                       show-overflow="tooltip"
                       highlight-hover-row
                       align="center"
                       header-align="center"
                       ref="xTree"
                       :loading="Loading"
                       :data="tableData">
                <vxe-table-column field="nodename" title="流程节点名称" align="center" min-width="60"/>
                <vxe-table-column field="role_name" title="任务审批角色" align="center" min-width="140"/>
                <vxe-table-column field="processstage_name" title="流程阶段" align="center"/>
                <vxe-table-column field="approvemodal_name" title="数据类型" align="center"/>
                <vxe-table-column field="busmodal_name" title="办理模块" align="center" />
                <vxe-table-column field="checkfile_name" title="是否校验要件" align="center"/>
                <vxe-table-column field="firstnode_name" title="是否第一节点" align="center"/>
                <vxe-table-column field="areacode_name" title="审批属地" align="center"/>
                <vxe-table-column field="sort" title="排序" align="center"/>
                <vxe-table-column field="" title="操作" min-width="70">
                    <template v-slot="{ row }">
                        <Button size="small" class="actionBtn" type="primary" style="margin-right: 5px"
                                @click="handleEdit(row)">编辑
                        </Button>
                        <Button size="small" class="actionBtn" type="info" style="margin-right: 5px"
                                @click="handleDetail(row)">详情
                        </Button>
                        <!--<Button size="small" class="actionBtn" type="error" style="margin-right: 5px"-->
                                <!--@click="handleDelete(row.id)">删除-->
                        <!--</Button>-->
                    </template>
                </vxe-table-column>
            </vxe-table>
            <!--
            <Page :total="dataCount" :page-size="pageSize" show-total class="paging"
                  @on-change="  handleTableChange" :current="pageNo"></Page>
             -->
        </div>
        <modal ref="modalForm" @ok="modalFormOk"/>
    </div>

</template>
<script>
    import {CommonMixin} from '@/views/common/js/CommonMixin'
    import {getAction, postAction} from '@/api/request'
    // import ICol from "view-design/src/components/grid/col";
    import Modal from './modules/ExtActNodeConfigModal'

    export default {
        mixins: [CommonMixin],
        components: { Modal},
        data() {
            return {
                columns: [],
                queryParam: {},
                processkey: "",
                Loading: true,
                url: {
                    list: "/api/ac/subsistence/extActNodeConfigService/list",
                    delete: "/api/ac/subsistence/extActNodeConfigService/delete"
                },
            }
        },
        methods: {
            loadData() {
                var that = this;
                that.Loading = true;
                postAction(this.url.list, {processkey: this.processkey}).then((res) => {
                    if (res.data.errcode != 0) {
                        that.$Message.error(res.data.errmsg);
                    } else {
                        that.tableData = res.data.data;
                    }
                }).finally(() => {
                    that.Loading = false;
                })
            },
            edit(processkey) {
                this.processkey = processkey;
                this.loadData();
            },
            handleAddNew() {
                this.$refs.modalForm.add(this.processkey);
                this.$refs.modalForm.title = "新增";
                this.$refs.modalForm.disableSubmit = false;
                this.$refs.modalForm.key = this.uuid();
            },
            modalFormOk() {
                // 新增/修改 成功时，重载列表
                this.loadData();
            },
        },

    }
</script>
<style scoped>
    .paging {
        float: right;
        margin-top: 10px;
    }

    /deep/ .ivu-upload-list {
        display: none;
    }

    /deep/ .ivu-table-cell {
        padding-right: 0px;
        padding-left: 0px;
    }

    /deep/ #area .ivu-col-span-8 {
        width: 50%;
    }

    #area :nth-child(3) {
        display: none;
    }
</style>
